364 research outputs found

    Search for Program Structure

    Get PDF
    The community of programming language research loves the Curry-Howard correspondence between proofs and programs. Cut-elimination as computation, theorems for free, \u27call/cc\u27 as excluded middle, dependently typed languages as proof assistants, etc. Yet we have, for all these years, missed an obvious observation: "the structure of programs corresponds to the structure of proof search". For pure programs and intuitionistic logic, more is known about the latter than the former. We think we know what programs are, but logicians know better! To motivate the study of proof search for program structure, we retrace recent research on applying focusing to study the canonical structure of simply-typed lambda-terms. We then motivate the open problem of extending canonical forms to support richer type systems, such as polymorphism, by discussing a few enticing applications of more canonical program representations

    Multi-Focusing on Extensional Rewriting with Sums

    Get PDF
    International audienceWe propose a logical justification for the rewriting-based equivalence procedure for simply-typed lambda-terms with sums of Lindley [Lin07]. It relies on maximally multi-focused proofs, a notion of canonical derivations introduced for linear logic. Lindley's rewriting closely corresponds to preemptive rewriting [CMS08], a technical device used in the meta-theory of maximal multi-focus

    2-or-more approximation for intuitionistic logic

    Get PDF
    In the context of the simply-typed lambda-calculus (propositionalintuitionistic logic) with products and sums, we will answer the followingquestion. Given a fixed logic proof and typing environment, the number of possible programs that correspond to this proof depends on the number of free variables of each type in the type environment. If we are not interested in the precise number of programs but only "zero, one, or two-or-more", is it correct to approximate the number of variables at each type by "zero, one, or two-or-more"

    Unboxed data constructors -- or, how cpp decides a halting problem

    Full text link
    We propose a new language feature for ML-family languages, the ability to selectively *unbox* certain data constructors, so that their runtime representation gets compiled away to just the identity on their argument. Unboxing must be statically rejected when it could introduce *confusions*, that is, distinct values with the same representation. We discuss the use-case of big numbers, where unboxing allows to write code that is both efficient and safe, replacing either a safe but slow version or a fast but unsafe version. We explain the static analysis necessary to reject incorrect unboxing requests. We present our prototype implementation of this feature for the OCaml programming language, discuss several design choices and the interaction with advanced features such as Guarded Algebraic Datatypes. Our static analysis requires expanding type definitions in type expressions, which is not necessarily normalizing in presence of recursive type definitions. In other words, we must decide normalization of terms in the first-order lambda-calculus with recursion. We provide an algorithm to detect non-termination on-the-fly during reduction, with proofs of correctness and completeness. Our termination-monitoring algorithm turns out to be closely related to the normalization strategy for macro expansion in the `cpp` preprocessor.Comment: Author version, to appear at POPL 202

    Estratégia de controle desacoplado de corrente aplicado ao motor síncrono de relutância

    Get PDF
    Esse trabalho de conclusão de curso propõe a comparação entre duas técnicas de controle de corrente para o acionamento de motores síncronos de relutância. Primeiramente são apresentadas características dessa máquina elétrica e seu modelo matemático é desenvolvido. Logo após, é desenvolvido um controlador por modos deslizantes com observador de distúrbios em tempo contínuo. Esse controlador apresenta grande minimização do acoplamento existente entre os eixos direto e em quadratura, e busca mitigar o efeito de distúrbios externos desconhecidos. São apresentadas as provas de estabilidade do controlador desenvolvido a partir de critério de Lyapunov. A fim de avaliar o comportamento do controlador desenvolvido, são executados, em software MATLAB/Simulink dois ensaios, um ensaio de variação de velocidade do motor e um ensaio de variação da carga acoplada ao eixo da máquina. Nesses ensaios, são observadas as correntes de eixo direto e em quadratura. Por fim, o desempenho do controlador apresentado é comparado com o desempenho de um controlador PI aplicado a mesma máquina e submetido aos mesmos ensaios. Observa-se que o controlador por modos deslizantes com observador de distúrbios minimizou o efeito do acoplamento existente entre as correntes dos eixos dq e apresentou resposta satisfatória também na presença de um distúrbio externo desconhecido, no ensaio com variação de carga, não apresentando oscilações quando há mudanças de referência.This undergraduate thesis proposes the comparison between two current control techniques for synchronous reluctance motors. Firstly, the characteristics of this electrical machine are presented, and its mathematical model is developed. Next, a sliding mode controller with a disturbance observer in continuous time is developed. This controller shows a significant minimization of the coupling between the direct and quadrature axes and seeks to mitigate the effect of unknown external disturbances. The stability proofs of the developed controller are presented based on the Lyapunov criterion. In order to evaluate the behavior of the developed controller, two tests, a speed variation test and a load variation test, are performed in software MATLAB/Simulink. In these tests, the direct and quadrature axis currents are observed. Finally, the performance of the presented controller is compared with the performance of a PI controller applied to the same machine and subjected to the same tests. It is observed that the sliding mode controller with disturbance observer minimized the effect of the coupling between the dq-axis currents and showed a satisfactory response even in the presence of an unknown external disturbance in the load variation test, without presenting oscillations when there are changes in reference

    Unfolding ML datatype declarations without loops

    Get PDF
    International audienc

    Frozen inference constraints for type-directed disambiguation

    Get PDF
    International audienceWe present work-in-progress on type inference in presence of type-directed name disambiguation (where an ambiguous name is resolved using type information), following the approach of constraint-based type inference. Our specific goal is to implement inference for OCaml sum/variant constructor disambiguation, and our approach is to introduce "frozen constraints", a more general constraint mechanism. We have a prototype implementation of frozen constraints in the Inferno library, and discuss the implementation and meta-theoretical challenges

    Un usage de la réduction paresseuse forte pour OCaml

    Get PDF
    International audienceWe present a use-case for strong call-by-need reduction motivated not by a proof assistant, but by the normalization of module "shapes" in the OCaml compiler for tooling purposes

    Backtracking reference stores

    Get PDF
    National audienceFrançois Pottier's unionFind library is parameterized over an underlying store of mutable references, and provides the usual references, transactional reference stores (for rolling back some changes in case of higher-level errors), and persistent reference stores. We extend this library with a new implementation of backtracking reference stores, to get a Union-Find implementation that efficiently supports arbitrary backtracking and also subsumes the transactional interface. Our backtracking reference stores are not specific to unionFind, they can be used to build arbitrary backtracking data structures. The natural implementation, using a journal to record all writes, provides amortized-constant-time operations with a space overhead linear in the number of store updates. A refined implementation reduces the memory overhead to be linear in the number of store cells updated, and gives performance that match non-backtracking references in practice

    Boxroot, fast movable GC roots for a better FFI

    Get PDF
    International audienceWe propose a new API and implementation for managing garbage collector (GC) roots for the OCaml foreign-function interface (FFI), which offers:- better performance than existing APIs (local or global roots);- efficient support for OCaml 5 with a more multicore-friendly design, with per-domain data structures;- a reasoning based on resource-management idioms, enabling an easier FFI for Rust.Our contributions include a C library called Boxroot which is already in use in several OCaml-Rust interfacing libraries.We believe that this approach generalizes beyond OCaml, to other FFI situations where a language with GC interacts with a language without pervasive GC, especially those that emphasize move semantics for resource handling (typically C++ or Rust); or even to future language explorations in mixing memory management techniques
    • …
    corecore